home *** CD-ROM | disk | FTP | other *** search
- // vcview.cpp : implementation of the CVcView class
- //
-
- #include "stdafx.h"
- #include "vc.h"
-
- #include "vcdoc.h"
- #include "vcview.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CVcView
-
- IMPLEMENT_DYNCREATE(CVcView, CFormView)
-
- BEGIN_MESSAGE_MAP(CVcView, CFormView)
- //{{AFX_MSG_MAP(CVcView)
- ON_VBXEVENT(VBN_CLICK, IDC_TOGGLE1, OnClickToggle1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CVcView construction/destruction
-
- CVcView::CVcView()
- : CFormView(CVcView::IDD)
- {
- //{{AFX_DATA_INIT(CVcView)
- m_toggle1 = NULL;
- //}}AFX_DATA_INIT
- // TODO: add construction code here
- }
-
- CVcView::~CVcView()
- {
- }
-
- void CVcView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CVcView)
- DDX_Control(pDX, IDC_EDIT1, m_edit1);
- DDX_VBControl(pDX, IDC_TOGGLE1, m_toggle1);
- //}}AFX_DATA_MAP
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CVcView diagnostics
-
- #ifdef _DEBUG
- void CVcView::AssertValid() const
- {
- CFormView::AssertValid();
- }
-
- void CVcView::Dump(CDumpContext& dc) const
- {
- CFormView::Dump(dc);
- }
-
- CVcDoc* CVcView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVcDoc)));
- return (CVcDoc*)m_pDocument;
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CVcView message handlers
-
- void CVcView::OnClickToggle1(UINT, int, CWnd*, LPVOID)
- {
- long option;
- char str[5];
-
- option=m_toggle1->GetNumProperty("Value");
- if (option) {
- sprintf(str,"%s",m_toggle1->GetStrProperty("OnCaption"));
- }
- else {
- sprintf(str,"%s",m_toggle1->GetStrProperty("OffCaption"));
- }
-
- m_edit1.SetWindowText(str);
-
- }
-